package com.agricultural.machine.observer;

/**
 * 环境数据类
 */
public class EnvironmentData {
    private final double soilMoisture;
    private final double soilPH;
    private final double temperature;
    private final double humidity;
    private final double windSpeed;
    private final String dataType;
    private final String location;

    public EnvironmentData(String dataType, String location, double soilMoisture, double soilPH, 
                          double temperature, double humidity, double windSpeed) {
        this.dataType = dataType;
        this.location = location;
        this.soilMoisture = soilMoisture;
        this.soilPH = soilPH;
        this.temperature = temperature;
        this.humidity = humidity;
        this.windSpeed = windSpeed;
    }

    public double getSoilMoisture() {
        return soilMoisture;
    }

    public double getSoilPH() {
        return soilPH;
    }

    public double getTemperature() {
        return temperature;
    }

    public double getHumidity() {
        return humidity;
    }

    public double getWindSpeed() {
        return windSpeed;
    }

    public String getDataType() {
        return dataType;
    }

    public String getLocation() {
        return location;
    }

    @Override
    public String toString() {
        return "环境数据 [类型=" + dataType + ", 位置=" + location + 
               ", 土壤湿度=" + soilMoisture + "%, pH值=" + soilPH + 
               ", 温度=" + temperature + "°C, 湿度=" + humidity + 
               "%, 风速=" + windSpeed + "m/s]";
    }
}







